<section class="Hui-container">
	<div class="Hui-wraper">	
		<div id="a-financials">		
			<h2>财务状况</h2>
			<h5>*是必填信息</h5>
			<div class="line"></div>
			<br>
			<form method="post" action="{:U('Afinancials/save')}" id="financials_form" class="form form-horizontal responsive">	
				<div class="row cl">
					<label class="form-label col-xs-4">*奖学金(你申请贷款的项目)：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" name="scholarship" maxlength="7" id="scholarship" datatype="integer" nullmsg="没有奖学金请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*公司或政府赞助(你申请贷款的项目)：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" name="sponsorship_company" maxlength="7" id="sponsorship_company" datatype="integer" nullmsg="无赞助请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*其他赞助(你申请贷款的项目)：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" name="sponsorship_family" maxlength="7" id="sponsorship_family" datatype="integer" nullmsg="无赞助请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*你的存款：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" name="saving" id="saving" datatype="integer" maxlength="8" nullmsg="请填写你的存款金额">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*你是否拥有房产？</label>
					<div class="formControls">
						<div class="radio-box col-xs-my">
							<input type="radio" id="property-1" name="property" value="1">
							<label for="property-1">是</label>
						</div>
						<div class="radio-box col-xs-my">
							<input type="radio" id="property-2" name="property" value="2">
							<label for="property-2">否</label>
						</div>			
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*其他资产：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" maxlength="8" name="other_asset" id="other_asset" datatype="integer" nullmsg="若无其他资产请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*年收入：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" maxlength="7" name="income" id="income" datatype="integer" nullmsg="请填写你目前的年收入">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*房贷(未还清部分)：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" maxlength="8" name="mortgage_outstanding" id="mortgage_outstanding" datatype="integer" nullmsg="若无房贷请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>
				<div class="row cl">
					<label class="form-label col-xs-4">*其他贷款(未还清部分)：</label>
					<div class="formControls col-xs-3">
						<input type="text" class="input-text" placeholder="人民币" name="loan_outstanding" id="loan_outstanding" datatype="integer" maxlength="8" nullmsg="若无其他贷款请填写0">
					</div>
					<div class="col-xs-5"> </div>
				</div>
				<br>			
				<div class="row cl">		
					<label class="form-label col-xs-4">*你的留学贷款还款将主要来自于：</label>
					<div class="formControls col-xs-3"> 
						<span class="select-box">
							<select class="select" size="1" id ="source_payment" name="source_payment" datatype="*" nullmsg="请选择还款来源">
								<option value="" selected>请选择你的还款来源</option>
								<option value="1">个人</option>
								<option value="2">父母</option>
								<option value="3">配偶</option>
								<option value="4">其他</option>										
							</select>
						</span> 
					</div>
					<div class="col-xs-5"> </div>
				</div>	
				<br>
				<div class="row cl">
					<div class="col-xs-10 col-xs-offset-4">
						<a href="{:U('Aemployment/index')}" class="btn btn-warning radius previous_form">上一步</a>
						<input class="btn btn-primary" type="submit" value="&nbsp;&nbsp;保存&下一步&nbsp;&nbsp;">
					</div>
				</div>
			</form>		
		</div>
	</div>
</section>

<script>
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#financials_form").Validform({
		tiptype:2
	});
	var obj1 = document.getElementsByName('property');
	for(i = 0; i < obj1.length; i++){  
	    if(obj1[i].value == "{$data.property}") 
	        obj1[i].checked = true;       
	}
	for(var i=0;i<document.getElementById('source_payment').options.length;i++) {  
        if(document.getElementById('source_payment').options[i].value =="{$data.source_payment}") {  
        	document.getElementById('source_payment').options[i].selected = true;  
            break;  
        }  
    } 	
	document.getElementById('loan_outstanding').value="{$data.loan_outstanding}";
	document.getElementById('mortgage_outstanding').value="{$data.mortgage_outstanding}";
	document.getElementById('other_asset').value="{$data.other_asset}";
	document.getElementById('income').value="{$data.income}";
	document.getElementById('sponsorship_family').value="{$data.sponsorship_family}";
	document.getElementById('sponsorship_company').value="{$data.sponsorship_company}";
	document.getElementById('saving').value="{$data.saving}";
	document.getElementById('scholarship').value="{$data.scholarship}";
});
</script>	
		